import random
num = random.randint(1,100)
count = 0
while True:
    guess = int(input('请输入你猜测的数字：'))
    count += 1
    if guess == num:
        print(f'恭喜你猜对了，共用了{count}次')
        break
    elif guess > num:
        print('你猜大了')
    else :
        print('你猜小了')